package com.zx.mes.hyl.array;

import org.junit.Test;

/**
 * int Array 测试
 * @author huayunlong
 * @date 2018-7-12
 */
public class TestIntArray {

    @Test
    public void test(){
        Array array = new Array();
        for (int i = 0; i < array.length(); i++) {
            array.add(i);
        }
        System.out.println(array);
//        array.remove(2);
//        array.removeFirst();
//        array.removeLast();
//        array.remove(10);
        array.add(11);
        System.out.println(array);
        array.removeFirst();
        array.removeLast();
        array.removeLast();
        array.removeLast();
        array.removeLast();
        array.removeLast();
        array.removeLast();
        System.out.println(array);
    }

    @Test
    public void test2(){
        HArray<Person> array = new HArray<>();
        Person p = new Person();
        p.setName("张三");
        p.setPassword("123456");
        array.add(p);

        Person p2 = new Person();
        p2.setName("李四");
        p2.setPassword("654321");
        array.add(p2);

        System.out.println(array);
        System.out.println(array.get(0));
    }
}
